package com.fan.controller;

import com.fan.entity.Teacher;
import com.fan.service.TeacherService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: self-tui-education
 * @description:
 * @author: 老范
 * @create: 2022-05-06 15:03
 **/
@RestController
@RequestMapping("/order/teacher")
public class TeacherController {
    @Autowired
    private TeacherService teacherService;

    @PostMapping("/queryAllTeacherBYTeacherName/{teacherName}")
    public CommonResult queryAllTeacherBYTeacherName(@PathVariable("teacherName") @RequestBody String teacherName){
        CommonResult commonResult = teacherService.queryAllTeacherBYTeacherName(teacherName);
        return commonResult;
    }

    @GetMapping("/findTeacherBYMobile/{mobile}")
    public CommonResult findTeacherBYMobile(@PathVariable("mobile") String mobile){
        return teacherService.findTeacherBYMobile(mobile);
    }

    @PostMapping("/updateTeacherBYMobile")
    public CommonResult updateTeacherBYMobile(@RequestBody Teacher teacher){
        return teacherService.updateTeacherBYMobile(teacher);
    }

}
